<?php $this->load->view('layout/header'); ?>
<form name="form1" method="post" action="<?php echo site_url('main/resetpassword')?>" onsubmit="javascript:return WebForm_OnSubmit();" id="form1">
    <div id="container">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table_form">
            <tr class="table_form_title">
                <td colspan="4">
                    修改密码
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>管理员帐号：
                </td>
                <td>
                    <span id="lblAdminName"><?php echo $this->session->userdata['user_name']?></span>
                    &nbsp;
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>旧密码：
                </td>
                <td>
                    <input name="adminpass" type="password" id="adminpass" style="width:125px;" />
                    <span id="adminpass_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>新密码：
                </td>
                <td>
                    <input name="newadminpass" type="password" id="newadminpass" style="width:125px;" />
                    <span id="newadminpass_tips" style="color:Red;display:none;">不能为空</span>
                </td>
            </tr>
            <tr class="table_form_row">
                <td style="width: 15%" align="right">
                    <span class="star">*</span>新密码确认：
                </td>
                <td>
                    <input name="newadminpassconfirm" type="password" id="newadminpassconfirm" style="width:125px;" />
                    &nbsp;
                    <span id="newadminpassconfirm_tips" style="color:Red;display:none;">不能为空</span>
                    <span id="newadminpassconfirm_confirm" style="color:Red;display:none;">两次新密码不一致</span>
                </td>
            </tr>
            <tr class="table_form_btn">
                <td align="right">
                    &nbsp;
                </td>
                <td colspan="3">
                    <input type="submit"value="保存" id="btnSave" />
                    <input type="reset" name="button" value="重置" />
		    <?php if($message){?>
                    <span id="errMsg" style="color:Red;"><?php echo $message;?></span>
		    <?php }?>
                </td>
            </tr>
        </table>
    </div>
</form>
<script type="text/javascript">
$('#form1').submit(function() {
	var is = true;
	if (!input_tips($('#adminpass'))) {
	    is = false;
	}
	if (!input_tips($('#newadminpass'))) {
	    is = false;
	}
	if (!input_tips($('#newadminpassconfirm'))) {
	    is = false;
	}
	var new_pass = $('#newadminpass').val();
	var new_pass_con = $('#newadminpassconfirm').val();
	if(new_pass !== new_pass_con){
	    $('#newadminpassconfirm_confirm').show();
	    is = false;
	}else{
	    $('#newadminpassconfirm_confirm').hide();
	}
	return is;
});
</script>
</body>
</html>

